import api from '../../api/index'
Page({
  data: {
    list: [1, 1, 2, 1, 2, 12, 2, 12, 12, 21,],
    items: {
      title: '西安校友会成功举办“翠华寻春健步行”活动',
      url: '/assets/images/common/banner.png',
      id: 1,
      content: '最是一年春好处，绝胜烟柳满皇都”。四月的古都西安，花红柳绿，春意盘然。为了但进炼',
      time: '2023-08-11'
    },
    isBottom: false
  },
  onLoad(options) {
    this.getTabBar().init('activity');
  },
  onReady() {

  },
  onShow() {

  },
  onHide() {

  },
  onUnload() {

  },
  onReachBottom() {
    const { isBottom, list } = this.data
    if (isBottom) return
    this.setData({ isBottom: true })
    setTimeout(() => {
      const datalist = list.concat(list)
      const isBottom = 79 > datalist.length ? false : true
      this.setData({ list: datalist, isBottom })
    }, 2000);
  },

  onShareAppMessage() {

  },
  gotoDetail(e) {
    const { url, id } = e.currentTarget.dataset
    console.log(`${url}?id=${id}`);
    wx.navigateTo({ url: `${url}?id=${id}` })
  }
})